﻿// Developer Express Code Central Example:
// How to create a GridView descendant class and register it for design-time use
// 
// This is an example of a custom GridView and a custom control that inherits the
// DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening
// Form1 in the designer. Please refer to the http://www.devexpress.com/scid=A859
// Knowledge Base article for the additional information.
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E900

using System;
using DevExpress.Utils;
using System.Drawing;

namespace VNPT.Control {
	public class MyGridView : DevExpress.XtraGrid.Views.Grid.GridView {
		public MyGridView() : this(null) {}
		public MyGridView(DevExpress.XtraGrid.GridControl grid) : base(grid) {
            this.OptionsView.EnableAppearanceEvenRow = true;
           // this.OptionsView.EnableAppearanceOddRow = true;
            this.IndicatorWidth = 60;
            this.CustomDrawRowIndicator += (a, e) =>
            {
                if (e.Info.IsRowIndicator && e.RowHandle >= 0)
                {
                    e.Info.DisplayText = (e.RowHandle + 1).ToString("00,0");
                    e.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
                    e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Italic);
                    e.Handled = false;
                }
            };
            this.OptionsView.ColumnAutoWidth = false;
            this.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never;
            this.OptionsView.ShowGroupPanel = false;
		}
		protected override string ViewName { get { return "MyGridView"; } }
	}
}
